﻿using Microsoft.Win32.SafeHandles;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace Tester.Views;
public class CommonConfig : IDisposable
{
    public List<string> themes { get; set; }

    public string Username { get; set; } = "Default";

    public string Platform { get; set; }

    public CommonConfig()
    {
        themes = new List<string>();
#if WINDOWS
        Platform = "windows";
#elif MACCATALYST
        Platform = "macos";
#else
        Platform = "mobile";
#endif
    }

    public void Dispose() => Dispose(true);
    private bool _disposedValue;
    private SafeHandle _safeHandle = new SafeFileHandle(IntPtr.Zero, true);
    protected virtual void Dispose(bool disposing)
    {
        if (!_disposedValue)
        {
            if (disposing)
            {
                _safeHandle.Dispose();
            }

            _disposedValue = true;
        }
    }

}
